/**
 * 五商课程
 */
import type { GetFiveWisdomDetailParams, GetFiveWisdomDetailResult, GetFiveWisdomListParams, GetFiveWisdomListResult, GetRollcallRecordResult } from './type';
import { get, post } from '@/utils/request';

enum URL {
  getFiveWisdomList = '/app/custCourse/fiveWisdom',
  getFiveWisdomDetail = '/app/custCourse/fiveWisdomDetail',
  getCourseInfo = '/app/custCourse/courseInfo',
  getRollcallRecord = '/app/custCourse/rollcallRecord',
  getUserTrustClass = '/app/custCourse/userTrustClass',
}

// 五商课程列表
export const getFiveWisdomList = (data: GetFiveWisdomListParams) => get<GetFiveWisdomListResult>({ url: URL.getFiveWisdomList, data });

// 五商课程详情
export const getFiveWisdomDetail = (data: GetFiveWisdomDetailParams) => get<{ rows: Array<GetFiveWisdomDetailResult>; total: number }>({ url: URL.getFiveWisdomDetail, data });

// 课程信息
export const getCourseInfo = (data: { courseId: string | number }) => post<any>({ url: URL.getCourseInfo, data });

// 托管课表
export const getRollcallRecord = (data: { month: string }) => post<GetRollcallRecordResult>({ url: URL.getRollcallRecord, data });

// 是否报托管班 1-有托管班，0-没有
export const getUserTrustClass = () => get<{ flag: number }>({ url: URL.getUserTrustClass });
